<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String bp = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String __MANAGER = bp+"admin/";
String __SHOWMAINVIEW = __MANAGER+"showModule.do";
String __CREATEMENUBUTTON = __MANAGER+"createMenuButton.do";
%>

<!DOCTYPE html>
<html>
  <head>
    <title>SWIFT4J快速开发平台</title>
  </head>
  
<body>
	<div class="d-1">
		<h2 class="h2-ac">治疗史调查</h2>
		<div class="d-b1">
		      <form name="treathisForm1" onsubmit="return false;">
				<input type="hidden" name="treathis.treathisId" value="${treathis.treathisId }"/>
				<input type="hidden" name="patientDoc.docId" value="${patientDoc.docId }"/>
		      	<table border="0" cellspacing="0" cellpadding="15" class="fs16">
		      		<tr>
		      		    <td class="ta-r"><label id="">是否使用过西药治疗：</label></td>
		      		    <td>
		      		    	<input type="radio" name="treathis.respirator" value="1" <c:if test="${treathis.respirator == 1 }">checked="checked"</c:if> >是
		      		    	<input type="radio" name="treathis.respirator" value="2" <c:if test="${treathis.respirator == 2 }">checked="checked"</c:if> >否
		      		    </td>
		      		</tr>
		      		<tr>
		      		     <td class="ta-r pb45">使用药物有：</td>
		      		     <td class="used-medc" id="wmMedicineId">
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_1 eq 1 }">checked="checked"</c:if> >溴吡斯的明</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_2 eq 1 }">checked="checked"</c:if> >醋酸泼尼松</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_3 eq 1 }">checked="checked"</c:if> >甲泼尼龙</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_4 eq 1 }">checked="checked"</c:if> >硫唑嘌呤</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_5 eq 1 }">checked="checked"</c:if> >环孢素</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_6 eq 1 }">checked="checked"</c:if> >他克莫司</span>
		      			<br/>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_7 eq 1 }">checked="checked"</c:if> >雷公藤多苷</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_8 eq 1 }">checked="checked"</c:if> >环磷酰胺</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_9 eq 1 }">checked="checked"</c:if> >吗替麦考酚酯</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_10 eq 1 }">checked="checked"</c:if> >甲氨蝶呤</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_11 eq 1 }">checked="checked"</c:if> >丙种球蛋白</span>
		      			<span><input type="checkbox" name="" value="1" <c:if test="${wm_12 eq 1 }">checked="checked"</c:if> >血浆置换</span>
		      		      </td>
		      		</tr>
		      		<tr>
		      		      <td></td>
		      		      <td>
		      		      	<table id="wmTableId" border="1" cellspacing="0" cellpadding="5" class="fs16 ta-c medc-tb" >
								<tr>
									<td>治疗药物</td>
									<td>服用剂量</td>
									<td>用药时间</td>
									<td>最大剂量</td>
									<td>治疗效果</td>
								</tr>
								<c:choose>
									<c:when test="${not empty treathis.wm }">
										<c:forEach items="${treathis.wm }" var="wm">
											<input type="hidden" name="wmId" value="${wm.wmId }"/>
											<tr>
												<td><input type="text" name="wmName" value="${wm.name }"></td>
												<td><input type="text" name="wmDosage" value="${wm.dosage }"></td>
												<td><input type="text" name="wmDate" value="${wm.date }"></td>
												<td><input type="text" name="wmMaxDosage" value="${wm.maxDosage }"></td>
												<td><input type="text" name="wmResult" value="${wm.result }"></td>
											</tr>
										</c:forEach>
									</c:when>
									<c:when test="${empty treathis.wm }">
										<input type="hidden" name="wmId" value=""/>
										<td><input type="text" name="wmName" value=""></td>
										<td><input type="text" name="wmDosage" value=""></td>
										<td><input type="text" name="wmDate" value=""></td>
										<td><input type="text" name="wmMaxDosage" value=""></td>
										<td><input type="text" name="wmResult" value=""></td>
									</c:when>
								</c:choose>
							</table>
		      		      </td>
		      		</tr>
		      	</table>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="treathisSave1()">保存</a>

		      </form>
		</div>

		<div class="d-b1">
		      <form name="treathisForm2" onsubmit="return false;">
				<input type="hidden" name="treathis.treathisId" value="${treathis.treathisId }"/>
				<input type="hidden" name="patientDoc.docId" value="${patientDoc.docId }"/>
		      	<table border="0" cellspacing="0" cellpadding="15" class="fs16">
		      	      <tr>
		      	      	<td class="ta-r">是否使用中药治疗：</td>
		      	      	<td>
		      	      	      <input type="radio" name="" value="1" <c:if test="${not empty treathis.cm }">checked="checked"</c:if> >是
		      	      	      <input type="radio" name="" value="2" <c:if test="${empty treathis.cm }">checked="checked"</c:if> >否
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">用药时间：</td>
		      	      	<td><input type="text" name="cm_sDate" value="${treathis.cm[0].sDate }"><span class="p10">至</span><input type="date" name="cm_eDate" value="${treathis.cm[0].eDate }"></td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">具体中药：</td>
		      	      	<td ><input type="text" name="cmName" value="${treathis.cm[0].name }"></td>
		      	      </tr>
		      	</table>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="treathisSave2()">保存</a>
		      	
		      </form>
		</div>

		<div class="d-b1">
		      <form name="treathisForm3" onsubmit="return false;">
				<input type="hidden" name="treathis.treathisId" value="${treathis.treathisId }"/>
				<input type="hidden" name="patientDoc.docId" value="${patientDoc.docId }"/>
		      	<table border="0" cellspacing="0" cellpadding="15" class="fs16">
		      	      <tr>
		      	      	<td class="ta-r">是否使用呼吸机呼吸：</td>
		      	      	<td>
		      		    	<input type="radio" name="treathis.respirator" value="1" <c:if test="${treathis.respirator == 1 }">checked="checked"</c:if> >是
		      		    	<input type="radio" name="treathis.respirator" value="2" <c:if test="${treathis.respirator == 2 }">checked="checked"</c:if> >否
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">使用时间：</td>
		      	      	<td><input type="text" name="treathis.respirator_date" value="${treathis.respirator_date }"></td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">使用方式：</td>
		      	      	<td>
		      	      	      <input type="radio" name="treathis.respirator_type" value="1" <c:if test="${treathis.respirator_type == 1 }">checked="checked"</c:if> >无创呼吸机辅助通气
		      	      	      <input type="radio" name="treathis.respirator_type" value="2" <c:if test="${treathis.respirator_type == 2 }">checked="checked"</c:if> >有创呼吸辅助通气
		      	      	</td>
		      	      </tr>
		      	</table>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="treathisSave3()">保存</a>
		      	
		      </form>
		</div>

		<div class="d-b1">
		      <form name="treathisForm4" onsubmit="return false;">
				<input type="hidden" name="treathis.treathisId" value="${treathis.treathisId }"/>
				<input type="hidden" name="patientDoc.docId" value="${patientDoc.docId }"/>
		      	<table border="0" cellspacing="0" cellpadding="15" class="fs16">
		      	      <tr>
		      	      	<td class="ta-r">是否行胸腺切除术：</td>
		      	      	<td>
		      	      	      <input type="radio" name="treathis.thymusectomy" value="1" <c:if test="${treathis.thymusectomy == 1 }">checked="checked"</c:if> >是
		      	      	      <input type="radio" name="treathis.thymusectomy" value="2" <c:if test="${treathis.thymusectomy == 2 }">checked="checked"</c:if> >否
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">手术时间：</td>
		      	      	<td><input type="text" name="treathis.thymusectomy_date" value="${treathis.thymusectomy_date }"></td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">手术方式：</td>
		      	      	<td>
		      	      	      <input type="radio" name="treathis.thymusectomy_type" value="1" <c:if test="${treathis.thymusectomy_type == 1 }">checked="checked"</c:if> >微创
		      	      	      <input type="radio" name="treathis.thymusectomy_type" value="2" <c:if test="${treathis.thymusectomy_type == 2 }">checked="checked"</c:if> >开胸
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">有无放疗：</td>
		      	      	<td>
		      	      	      <input type="radio" name="treathis.thymusectomy_rt" value="1" <c:if test="${treathis.thymusectomy_rt == 1 }">checked="checked"</c:if> >有
		      	      	      <input type="radio" name="treathis.thymusectomy_rt" value="2" <c:if test="${treathis.thymusectomy_rt == 2 }">checked="checked"</c:if> >无
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">有无化疗：</td>
		      	      	<td>
		      	      	      <input type="radio" name="treathis.thymusectomy_ct" value="1" <c:if test="${treathis.thymusectomy_ct == 2 }">checked="checked"</c:if> >有
		      	      	      <input type="radio" name="treathis.thymusectomy_ct" value="2" <c:if test="${treathis.thymusectomy_ct == 2 }">checked="checked"</c:if> >无
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r pb80">胸腺病理：</td>
		      	      	<td>
		      	      	      <ul>
		      	      	      	<li><span class="pr30 d-ib"><input type="radio" name="treathis.thymusectomy_pt" value="1" <c:if test="${treathis.thymusectomy_pt == 1 }">checked="checked"</c:if> >A型</span>上皮状瘤细胞呈椭圆形或梭形</li>
		      	      	      	<li><span class="pr30 d-ib"><input type="radio" name="treathis.thymusectomy_pt" value="2" <c:if test="${treathis.thymusectomy_pt == 2 }">checked="checked"</c:if> >B型</span>上皮瘤状细胞呈皮质样或树突状，根据上皮状瘤细胞及上皮状淋巴细胞比率卡的异型性可进一步将患者分为B1-B3型</li>
		      	      	      	<li><span class="pr30 d-ib"><input type="radio" name="treathis.thymusectomy_pt" value="3" <c:if test="${treathis.thymusectomy_pt == 3 }">checked="checked"</c:if> >AB型</span>肿瘤同时具有A型或B型特点</li>
		      	      	      	<li><span class="pr30 d-ib"><input type="radio" name="treathis.thymusectomy_pt" value="4" <c:if test="${treathis.thymusectomy_pt == 4 }">checked="checked"</c:if> >C型</span>非器官样恶性胸腺瘤细胞异型性更加显著，但并非胸腺瘤特有，而是源自于胸腺外组织</li>
		      	      	      </ul>
		      	      	</td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">术后复查胸部CT情况：</td>
		      	      	<td ><input type="text" name="treathis.thymusectomy_ex" value="${treathis.thymusectomy_ex }"></td>
		      	      </tr>
		      	      <tr>
		      	      	<td class="ta-r">初步治疗效果评价：</td>
		      	      	<td>
		      	      	      <input type="radio" name="treathis.thymusectomy_rs" value="1" <c:if test="${treathis.thymusectomy_rs == 1 }">checked="checked"</c:if> >痊愈
		      	      	      <input type="radio" name="treathis.thymusectomy_rs" value="2" <c:if test="${treathis.thymusectomy_rs == 2 }">checked="checked"</c:if> >有效
		      	      	      <input type="radio" name="treathis.thymusectomy_rs" value="3" <c:if test="${treathis.thymusectomy_rs == 3 }">checked="checked"</c:if> >无效
		      	      	</td>
		      	      </tr>
		      	</table>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" onclick="treathisSave4()">保存</a>
		      	
		      </form>
		</div>
		
	<script type="text/javascript">
	
		$(function() {
			//中药用药时间
			$('input[name="cm_sDate"]').datebox();
			//呼吸机使用时间
			$('input[name="treathis.respirator_date"]').datebox();
			//胸腺切除术手术时间
			$('input[name="treathis.thymusectomy_date"]').datebox();
		});
		
		function treathisSave1() {
			$(treathisForm1).form('submit',{
				url: __MANAGER+'myastheniaDoc_treathisSave1.do',
				success: function(data){
					var json = jQuery.parseJSON(data);
					if(json.rtnCode == 'success') {
						S4J.utils.showMessage(json.rtnMsg);
					}
					$('#t_treathis').panel('refresh');
				},
				onLoadError: function() {
					S4J.utils.showMessage('保存失败，请重试');
				}
			});
		}
		function treathisSave2() {
			$(treathisForm2).form('submit',{
				url: __MANAGER+'myastheniaDoc_treathisSave2.do',
				success: function(data){
					var json = jQuery.parseJSON(data);
					if(json.rtnCode == 'success') {
						S4J.utils.showMessage(json.rtnMsg);
					}
					$('#t_treathis').panel('refresh');
				},
				onLoadError: function() {
					S4J.utils.showMessage('保存失败，请重试');
				}
			});
		}
		function treathisSave3() {
			$(treathisForm3).form('submit',{
				url: __MANAGER+'myastheniaDoc_treathisSave3.do',
				success: function(data){
					var json = jQuery.parseJSON(data);
					if(json.rtnCode == 'success') {
						S4J.utils.showMessage(json.rtnMsg);
					}
					$('#t_treathis').panel('refresh');
				},
				onLoadError: function() {
					S4J.utils.showMessage('保存失败，请重试');
				}
			});
		}
		
		function treathisSave4() {
			$(treathisForm4).form('submit',{
				url: __MANAGER+'myastheniaDoc_treathisSave4.do',
				success: function(data){
					var json = jQuery.parseJSON(data);
					if(json.rtnCode == 'success') {
						S4J.utils.showMessage(json.rtnMsg);
					}
					$('#t_treathis').panel('refresh');
				},
				onLoadError: function() {
					S4J.utils.showMessage('保存失败，请重试');
				}
			});
		}
		
		$(function() {
			$('#wmMedicineId input[type=checkbox]').click(function() {
				if($(this).is(':checked')) {
					var medicineName = $(this).parent().text();
					var html = '<tr><input type="hidden" name="wmId" value=""/>'+
						'<td><input type="text" name="wmName" value="'+medicineName+'"></td>'+
						'<td><input type="text" name="wmDosage" value=""></td>'+
						'<td><input type="text" name="wmDate" value=""></td>'+
						'<td><input type="text" name="wmMaxDosage" value=""></td>'+
						'<td><input type="text" name="wmResult" value=""></td></tr>';
					$(html).appendTo($('#wmTableId'));
				}
			});
		});
	</script>
</body>
</html>
